using System;
using System.Collections.Generic;
using System.Text;

using GReporting.Core.Layout;
namespace GReporting.Core.PagingAlgorithm
{
    public class DetailBuilder : AbstractPageBuilder
    {
        public override void Build(PageBuilderContext context)
        {
            context.CurrentBand = context.Report.Layout.detail;
            context.NextBandSet();
            if (isPrint(context.CurrentBand, context.Engine))
            {
                foreach (ReporteElement element in context.CurrentBand.reportElement)
                {
                    context.CurrentElement = element;
                    if (isPrint(element, context.Engine))
                    {
                        GElement p_element = ReportToPrint(context, GetMinRowIndex(context.CurrentBand));
                        p_element.Result = EvalElement(element, context.Engine);
                        context.CurrentPage.Elements.Add(p_element);
                    }
                }
                context.Y += PageBuilder.Detail_Height;
                context.PrintHeight += PageBuilder.Detail_Height;
                context.DataRowIndex++;
            }
        }
    }
}
